# Maintainer: Bruno Pagani <archange@archlinux.org>

_pkg=HeapDict
pkgname=python-${_pkg,,}
pkgver=1.0.1
pkgrel=6
pkgdesc="Heap with decrease-key and increase-key operations"
arch=(any)
url="https://github.com/DanielStutzbach/heapdict"
license=(BSD)
makedepends=(python-setuptools)
depends=(python)
checkdepends=(python-tests)
source=(https://files.pythonhosted.org/packages/source/${_pkg::1}/${_pkg}/${_pkg}-${pkgver}.tar.gz)
#source=(${url}/archive/${pkgver}/${pkgname}-${pkgver}.tar.gz)
sha256sums=('8495f57b3e03d8e46d5f1b2cc62ca881aca392fd5cc048dc0aa2e1a6d23ecdb6')

build() {
  cd ${_pkg}-${pkgver}
  python setup.py build
}

check() {
  cd ${_pkg}-${pkgver}
  python test_heap.py
}

package() {
  cd ${_pkg}-${pkgver}
  python setup.py install --prefix=/usr --root="${pkgdir}" --optimize=1 --skip-build
  install -Dm644 LICENSE -t "${pkgdir}"/usr/share/licenses/${pkgname}/
}
